package com.nuoniu.sibanyun.service.erp;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nuoniu.sibanyun.entity.erp.ErpProcessRouteDetail;
import com.nuoniu.sibanyun.entity.vo.ProcessRouteAndPriceDetailVo;

import java.util.List;

/**
 * <p>
 * 工艺明细 服务类
 * </p>
 *
 * @author 小啊刚
 * @since 2020-12-30
 */
public interface IErpProcessRouteDetailService extends IService<ErpProcessRouteDetail> {

    /**
     * 根据工艺id删除
     * @author 小啊刚
     * @date 2020-12-31
     */
    void deleteByPRId(Long prId);

    /**
     * 根据工艺路线ID 查询首工序
     * @param prId
     * @return
     */
    ErpProcessRouteDetail getFirstOrderDetail(Integer prId);

    /**
     * 查询下一道工序
     * @param prId
     * @param currentOrder
     * @return
     */
    ErpProcessRouteDetail getNextOrderDetail(Integer prId,Integer currentOrder);


    /**
     * 通过工艺明细 查询 工艺明细 以及 对应最新的工价
     * @param routeDetailIds
     * @return
     */
    List<ProcessRouteAndPriceDetailVo> listProcessRouteAndPriceDetailVoByRouteDetailIds(List<Integer> routeDetailIds);

    Page<ProcessRouteAndPriceDetailVo> listProcessRouteAndPriceDetailVo(Page<ProcessRouteAndPriceDetailVo> page, Integer prId, String searchKey, String keyWord);

}
